package com.elitel.frame.main.dao;

import java.util.List;

import com.elitel.frame.main.entity.BaseSqlFieldType;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Select;

public interface BaseSqlFieldTypeMapper{

    // batch add
    //@InsertProvider(type=BaseSqlFieldTypeMapper.class, method="insertBaseSqlFieldType")
    @Insert(" insert into base_sqlFieldType(guid, serviceId, fieldName, fieldJavaType, createDate, note) values (#{guid}, #{serviceId}, #{fieldName}, #{fieldJavaType}, #{createDate}, #{note})")
    int insertBaseSqlFieldType(BaseSqlFieldType baseSqlFieldType);

    // delete by serviceId
    @Delete("delete from base_sqlFieldType where serviceId = #{serviceId}")
    boolean deleteByServiceId(String serviceId);

    // find by serviceId
    @Select("select * from base_sqlFieldType where serviceId = #{serviceId}")
    List<BaseSqlFieldType> findByServiceId(String serviceId);
}
